// pages/detail/detail.js
const app = getApp();
const header = require('../../pages/components/header/header.js');
const data = Object.assign({}, header.data, {
  address: "",
  type: "",
  message: "",
  contact: ""
})
const config=Object.assign({},header,{


  data: data,
  onLoad(options) {
    this.getDetailInfo(options.id);
  },
  getDetailInfo(id) {
    wx.request({
      //   url: 'https://nuanwan.wekeji.cn/student/index.php/trade/get_list', 
      url: 'https://api.ooopn.com/collect/360/api.php',
      data: {
        distinct: app.globalData.distinct,
        id: id
      },
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: this.getDetailSucc.bind(this)
    })
  },
  getDetailSucc(res) {
    // const result=res.data.data;
    this.setData({
      // address: result.address,
      // type:result.type,
      // message: result.message,
      // contact: result.contact
      address: "广州市政府一个豪华的房子中的8楼最后一个房间",
      type: "sell",
      message: "小型哈巴犬售價500￥",
      contact: "10086"
    })
  },
  onShareAppMessage() {
    return {
      title: "萌宠交易平台",
      path: '/pages/detail/detail'
    }
  }
})
Page(config)